<div class="row">
  <%= render 'menu' %>

  <div class="col-md-10">
    <div class="card card-lg">
      <div class="card-body">
        <%= form_for @user, url: setting_path, method: :put, html: { enctype: "multipart/form-data" } do |f| %>
          <%= render "shared/error_messages", target: @user %>
          <div class="row">
            <div class="col-sm-9">
              <% if Setting.allow_change_login? %>
              <div class="form-group">
                <label class="control-label">用户名</label>
                <%= f.text_field :login, style: "width: 200px", class: "form-control", placeholder: "用户名" %>
              </div>
              <% end %>

              <div class="form-group">
                <label class="control-label">姓名</label>
                <%= f.text_field :name, style: "width: 200px", class: "form-control", placeholder: "姓名" %>
              </div>

              <div class="form-group">
                <label class="control-label">头像</label>
                <%= f.file_field :avatar, class: "form-control" %>
              </div>

              <div class="form-group">
                <label class="control-label">Email</label>
                <%= f.text_field :email, disabled: @user.email_locked?, class: "form-control", placeholder: "Email" %>
              </div>

              <div class="form-group form-check">
                <label for="user_email_public" class="form-check-label">
                  <%= f.check_box :email_public, class: "form-check-input" %> <%= t("users.email_permission")%>
                </label>
              </div>

              <div class="form-group">
                <label class="control-label">自我介绍</label>
                <%= f.text_area :bio, class: "form-control", rows: 6 %>
              </div>
            </div>
            <div class="col-sm-3">
              <div class="form-group avatar-preview" style="text-align: center;">
                <%= user_avatar_tag(@user, :lg, link: false) %>
              </div>
            </div>
          </div>
          <div class="form-actions hide-ios">
            <button type="submit" class="btn btn-primary" data-disable-with="<%= t("common.saving") %>"><%= t("users.update_profile")%></button>
          </div>
        <% end %>
      </div>
    </div>
  </div>
</div>
